package entility;

import java.util.ArrayList;
import java.util.List;

public class Notification {

	public Machine machine;
	public String type;
	public String message;

	public final static String HOST = "host";
	public final static String SERVER = "server";

	public final static String MESSAGEERROR = "error";
	public final static String MESSAGEACCEPT = "accept";
	public static final String CLIENT = "client";
	
	public static boolean print;


	public Notification()
	{

	}

	public Notification(List<String> joblist)
	{

		String machine[] = joblist.get(0).split(":");

		this.machine = new Machine(machine[0], Integer.parseInt(machine[1]));
		this.type = joblist.get(1);
		this.message = joblist.get(2);


	}
	@Override
	public String toString() {
		return "Notification [machine=" + machine + ", type=" + type
				+ ", message=" + message + "]";
	}

	public Machine getMachine() {
		return machine;
	}
	public void setMachine(Machine machine) {
		this.machine = machine;
	}


	public String getType() {
		return type;
	}
	public void setType(String type) {

		this.type = type;
	}
	public String getMessage() {
		return message;
	}
	public void setMessage(String message) {
		this.message = message;
	}


	public List<String > getJobData()
	{
		List<String> jobList = new ArrayList<String>();
		jobList.add(machine.toSend());
		jobList.add(type);
		jobList.add(message);
		return jobList;

	}



}
